﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Huirui.Cavan.Domain.MainBoundedContext.SystemModule;
using Huirui.Cavan.Domain.Seedwork;

namespace Huirui.Cavan.Domain.MainBoundedContext.PurchaseModule
{
    public class UnPay : Persistent<long>
    {
        protected string _unPayCode;
        protected PurchaseIdentifier.UnPayType _unPayType;
        protected decimal _discount;
        protected decimal _cost;
        protected decimal _leftAmount;
        protected string _currency;
        protected decimal _currencyRate;
        protected SystemIdentifier.PayType _payType;
        protected PurchaseIdentifier.PayCondition _payCondition;
        protected Account _payAccount;
        protected DateTime? _payDeadline;
        protected Supplier _supplier;
        protected Corporation _corporation;

        public UnPay(string unPayCode, PurchaseIdentifier.UnPayType unPayType, decimal discount, decimal cost, decimal leftAmount,
            SystemIdentifier.PayType payType, PurchaseIdentifier.PayCondition payCondition, Account payAccount, DateTime? payDeadline, string currency, decimal currencyRate,
            DateTime createDate, DateTime modifyDate, int editUser, Corporation corporation, Supplier supplier)
        {
            this._unPayCode = unPayCode;
            this._unPayType = unPayType;
            this._discount = discount;
            this._cost = cost;
            this._leftAmount = leftAmount;
            this._payType = payType;
            this._payCondition = payCondition;
            this._payAccount = payAccount;
            this._payDeadline = payDeadline;
            this._currency = currency;
            this._currencyRate = currencyRate;
            this._createDate = createDate;
            this._modifyDate = modifyDate;
            this._editUser = editUser;
            this._corporation = corporation;
            this._supplier = supplier;
        }

        public UnPay()
        {

        }

        #region Public Properties


        public virtual string UnPayCode
        {
            get { return _unPayCode; }
            set { _unPayCode = value; }
        }

        public virtual PurchaseIdentifier.UnPayType UnPayType
        {
            get { return _unPayType; }
            set { _unPayType = value; }
        }

        public virtual decimal Discount
        {
            get { return _discount; }
            set
            {
                _discount = value;
            }
        }

        public virtual decimal Cost
        {
            get { return _cost; }
            set { _cost = value; }
        }

        public virtual decimal LeftAmount
        {
            get { return _leftAmount; }
            set { _leftAmount = value; }
        }

        public virtual SystemIdentifier.PayType PayType
        {
            get { return _payType; }
            set
            {
                _payType = value;
            }
        }

        public virtual string Currency
        {
            get { return _currency; }
            set
            {
                if (value != null && value.Length > 20)
                    throw new ArgumentOutOfRangeException("Invalid value for Currency", value, value.ToString());
                _currency = value;
            }
        }

        public virtual decimal CurrencyRate
        {
            get { return _currencyRate; }
            set { _currencyRate = value; }
        }

        public virtual PurchaseIdentifier.PayCondition PayCondition
        {
            get { return _payCondition; }
            set
            {
                _payCondition = value;
            }
        }

        public virtual Account PayAccount
        {
            get { return _payAccount; }
            set
            {
                _payAccount = value;
            }
        }

        public virtual DateTime? PayDeadline
        {
            get { return _payDeadline; }
            set { _payDeadline = value; }
        }

        public virtual Supplier Supplier
        {
            get { return _supplier; }
            set { _supplier = value; }
        }

        public virtual Corporation Corporation
        {
            get { return _corporation; }
            set { _corporation = value; }
        }

        #endregion
    }
}
